casper.test.begin('homepage', 7, function suite(test) {
    casper.start('../../index.html', function() {
        test.assertTitle("西邮导航 - 点亮你的生活！", "homepage title is the one expected");
    	test.assertExists('form[action="http://lib.changxiaoyuan.com/"]', 'search form is found');
    })
    .then(function(){
    	//engine count
    	test.assertElementCount('.search__engine--list li', 5);
    })
    .thenClick('.search__engine--btn')
    .thenClick('.search__engine--list li:nth-child(2) a', function(){
    	test.assertExists('form[action="http://www.baidu.com/s"]', 'search of baidu form is found');
    })
    .thenClick('.search__engine--btn')
    .thenClick('.search__engine--list li:nth-child(3) a', function(){
    	test.assertExists('form[action="http://cn.bing.com/search"]', 'search of bing form is found');
    })
    .thenClick('.search__engine--btn')
    .thenClick('.search__engine--list li:nth-child(4) a', function(){
    	test.assertExists('form[action="http://www.google.com.hk/search"]', 'search of google form is found');
    })
    .thenClick('.search__engine--btn')
    .thenClick('.search__engine--list li:nth-child(5) a', function(){
    	test.assertExists('form[action="http://sogou.com/web"]', 'search of sogou form is found');
    })
    .run(function() {
        test.done();
    });
});